<template>
	<view style="">
		<view class="delta" @click="clickDelta">
			<u-icon name="arrow-left" size="46rpx" color="#333"></u-icon>
		</view>
		<view class="tabs-box">
			<u-tabs :list="tabsList" :current="current" @click="clickTabs" :scrollable="false" :activeStyle="activeStyle"></u-tabs>	
		</view>
		<oldIndex v-if="current==0"/>
		<classificationGoods v-else-if="current==1"/>
		<view style="padding-top: 180rpx" v-else>
			<createActivity />
		</view>
		
	</view>
</template>

<script>
	import oldIndex from './old_index/index.vue'
	import classificationGoods from './classificationGoods/classificationGoods.vue'
	import createActivity from '@/pages/createActivity/createActivity.vue'
	// pages/createActivity/createActivity
	export default {
		components: {
			oldIndex,
			classificationGoods,
			createActivity
		},
		data() {
			return {
				tabsList: [{
					name: '推荐',
					type: 0
				}, {
					name: '分类',
					type: 1
				}, {
					name: '创建',
					type: 2
				}],
				current:0,
				activeStyle:{
					fontWeight:700,
					fontSize:'34rpx'
				}
			}
		},
		onShow() {
			if(this.$ws) this.$ws.completeClose()
			uni.removeStorageSync('gameId');
		},
		onShareAppMessage (){},
		methods: {
			clickTabs(e){
				this.current=e.index
			},
			clickDelta(){
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style scoped>
.delta{
		position: fixed;
		left: 20rpx;
		top: 90rpx;
		z-index: 99;
	}
	.tabs-box{
		width: 360rpx;
		margin: 0 auto;
		padding: 80rpx 0 20rpx 0;
		background-color: #ffffff;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
	}

</style>
